package com.example.springboot.controller;

import com.example.springboot.entity.Patient;
import com.example.springboot.service.PatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/patient")
public class PatientController {
    @Autowired
    private PatientService patientService;
    @PostMapping("/add")
    public Map<String,Object> save(@RequestBody Patient patient){
        Map<String,Object> res=new HashMap<>();
        if(patientService.zwqz(patient) == 1){
            res.put("code",200);
            res.put("msg","操作成功");
        }
        return  res;
    }
}
